function test_global_average_pooling()
    % 创建模型实例
    model = model_cifar10();
    
    % 创建测试输入 (模拟卷积层输出)
    % 假设输入shape为 [1 8 8 128] (最后一个卷积层的输出)
    input = int8(randi([-128, 127], [1, 8, 8, 128]));
    
    % 测试全局平均池化
    output = model.global_average_pooling(input);
    
    % 显示输出形状和范围
    disp('Output shape:');
    disp(size(output));
    disp('Output range:');
    disp([min(output(:)), max(output(:))]);
    
    % 验证输出维度
    assert(isequal(size(output), [1, 128]), 'Incorrect output dimensions');
    assert(isa(output, 'int8'), 'Output should be int8');
end 